package com.springboot.service.Impl;

import com.springboot.entity.Product;
import com.springboot.mapper.ProductMapper;
import com.springboot.service.ProductService;
import com.springboot.vo.SearchProductVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class ProductServiceImpl implements ProductService {
    @Autowired
    ProductMapper productMapper;

    /*
    添加商品;
     */
    @Override
    public Integer AddProduct(Product product) {
        return productMapper.AddProduct(product);
    }

    /*
    查看库存中是否有该商品;
     */
    @Override
    public Product LookUpProduct(Integer skuId) {
        return productMapper.LookUpProduct(skuId);
    }

    /*
    删除商品
     */
    @Override
    public Integer DeleteProduct(Integer skuId) {
        return productMapper.DeleteProduct(skuId);
    }

    /*
    多条件查询商品
     */
    @Override
    public List<Product> LookProductManyCondition(SearchProductVo searchProductVo) {
        return productMapper.LookProductManyCondition(searchProductVo);
    }

    /*
    更新商品信息;
     */
    @Override
    public Integer UpdateProduct(Product product) {
        return productMapper.UpdateProduct(product);
    }
}
